{% if memory %}
    <div class="alert alert-primary center">
        <a class="btn btn-secondary btn-sm" href="{% url "full_memory_dump_file" id %}" data-bs-toggle="tooltip" title="Download file"><span class="fas fa-download"></span> Full Memory Dump</a>
        <a class="btn btn-secondary btn-sm" href="{% url "full_memory_dump_strings" id %}" data-bs-toggle="tooltip" title="Download strings"><span class="fas fa-download" ></span> Full Memory Dump Strings</a>
    </div>
    <div class="tabbable tabs">
        <ul class="nav nav-tabs" style="margin-bottom: 0;">
            {% if memory.pslist %}<li class="nav-item active"><a class="nav-link" href="#memory_pslist" data-toggle="tab">Process List</a></li>{% endif %}
            {% if memory.psscan %}<li class="nav-item"><a class="nav-link" href="#memory_psscan" data-toggle="tab">Process Scan</a></li>{% endif %}
            {% if memory.psscan and memory.pslist %}<li class="nav-item"><a class="nav-link" href="#memory_rootkit" data-toggle="tab">Rootkits</a></li>{% endif %}
            {% if memory.svcscan %}<li class="nav-item"><a class="nav-link" href="#memory_svcscan" data-toggle="tab">Services</a></li>{% endif %}
            {% if memory.modscan %}<li class="nav-item"><a class="nav-link" href="#memory_modscan" data-toggle="tab">Kernel Modules</a></li>{% endif %}
            {% if memory.devicetree %}<li class="nav-item"><a class="nav-link" href="#memory_devicetree" data-toggle="tab">Device Tree</a></li>{% endif %}
            {% if memory.malfind %}<li class="nav-item"><a class="nav-link" href="#memory_malfind" data-toggle="tab">Code Injection</a></li>{% endif %}
            {% if memory.timers %}<li class="nav-item"><a class="nav-link" href="#memory_timers" data-toggle="tab">Timers</a></li>{% endif %}
            {% if memory.messagehooks %}<li class="nav-item"><a class="nav-link" href="#memory_messagehooks" data-toggle="tab">Messagehooks</a></li>{% endif %}
            {% if memory.apihooks %}<li class="nav-item"><a class="nav-link" href="#memory_apihooks" data-toggle="tab">API Hooks</a></li>{% endif %}
            {% if memory.callbacks %}<li class="nav-item"><a class="nav-link" href="#memory_callbacks" data-toggle="tab">Callbacks</a></li>{% endif %}
            {% if memory.yarascan %}<li class="nav-item"><a class="nav-link" href="#memory_yarascan" data-toggle="tab">Yarascan</a></li>{% endif %}
            {% if memory.ssdt %}<li class="nav-item"><a class="nav-link" href="#memory_ssdt" data-toggle="tab">SSDT</a></li>{% endif %}
            {% if memory.idt %}<li class="nav-item"><a class="nav-link" href="#memory_idt" data-toggle="tab">IDT</a></li>{% endif %}
            {% if memory.gdt %}<li class="nav-item"><a class="nav-link" href="#memory_gdt" data-toggle="tab">GDT</a></li>{% endif %}
            {% if memory.privs %}<li class="nav-item"><a class="nav-link" href="#memory_privs" data-toggle="tab">Privilege</a></li>{% endif %}
            {% if memory.handles %}<li class="nav-item"><a class="nav-link" href="#memory_handles" data-toggle="tab">Handles</a></li>{% endif %}
            {% if memory.getsids %}<li class="nav-item"><a class="nav-link" href="#memory_getsids" data-toggle="tab">Sid by Process</a></li>{% endif %}
            {% if memory.dlllist %}<li class="nav-item"><a class="nav-link" href="#memory_dlllist" data-toggle="tab">Dll List</a></li>{% endif %}
            {% if memory.mutantscan %}<li class="nav-item"><a class="nav-link" href="#memory_mutantscan" data-toggle="tab">Mutex</a></li>{% endif %}
            {% if memory.sockscan or memory.netscan %}
            <li class="nav-item"><a class="nav-link" href="#memory_sockets" data-toggle="tab">Sockets</a></li>
            {% endif %}
        </ul>

        <div class="tab-content">
            {% if memory.pslist %}
            <div class="tab-pane fade show active" id="memory_pslist">
                {% include "analysis/memory/_pslist.html" %}
            </div>
            {% endif %}
            {% if memory.psscan %}
            <div class="tab-pane fade show" id="memory_psscan">
                {% include "analysis/memory/_psscan.html" %}
            </div>
            {% endif %}
            {% if memory.psscan and memory.pslist %}
            <div class="tab-pane fade show" id="memory_rootkit">
                {% include "analysis/memory/_rootkit.html" %}
            </div>
            {% endif %}
            {% if memory.svcscan %}
            <div class="tab-pane fade show" id="memory_svcscan">
                {% include "analysis/memory/_svcscan.html" %}
            </div>
            {% endif %}
            {% if memory.modscan %}
            <div class="tab-pane fade show" id="memory_modscan">
                {% include "analysis/memory/_modscan.html" %}
            </div>
            {% endif %}
            {% if memory.devicetree %}
            <div class="tab-pane fade show" id="memory_devicetree">
                {% include "analysis/memory/_devicetree.html" %}
            </div>
            {% endif %}
            {% if memory.malfind %}
            <div class="tab-pane fade show" id="memory_malfind">
                {% include "analysis/memory/_malfind.html" %}
            </div>
            {% endif %}
            {% if memory.apihooks %}
            <div class="tab-pane fade show" id="memory_apihooks">
                {% include "analysis/memory/_apihooks.html" %}
            </div>
            {% endif %}
            {% if memory.ssdt %}
            <div class="tab-pane fade show" id="memory_ssdt">
                {% include "analysis/memory/_ssdt.html" %}
            </div>
            {% endif %}
            {% if memory.idt %}
            <div class="tab-pane fade show" id="memory_idt">
                {% include "analysis/memory/_idt.html" %}
            </div>
            {% endif %}
            {% if memory.gdt %}
            <div class="tab-pane fade show" id="memory_gdt">
                {% include "analysis/memory/_gdt.html" %}
            </div>
            {% endif %}
            {% if memory.timers %}
            <div class="tab-pane fade show" id="memory_timers">
                {% include "analysis/memory/_timers.html" %}
            </div>
            {% endif %}
            {% if memory.messagehooks %}
            <div class="tab-pane fade show" id="memory_messagehooks">
                {% include "analysis/memory/_messagehooks.html" %}
            </div>
            {% endif %}
            {% if memory.yarascan %}
            <div class="tab-pane fade show" id="memory_yarascan">
                {% include "analysis/memory/_yarascan.html" %}
            </div>
            {% endif %}
            {% if memory.callbacks %}
            <div class="tab-pane fade show" id="memory_callbacks">
                {% include "analysis/memory/_callbacks.html" %}
            </div>
            {% endif %}
            {% if memory.sockscan %}
            <div class="tab-pane fade show" id="memory_sockets">
                {% include "analysis/memory/_sockscan.html" %}
            </div>
            {% elif memory.netscan %}
            <div class="tab-pane fade show" id="memory_sockets">
                {% include "analysis/memory/_netscan.html" %}
            </div>
            {% endif %}
            {% if memory.privs %}
            <div class="tab-pane fade show" id="memory_privs">
                {% include "analysis/memory/_privs.html" %}
            </div>
            {% endif %}
            {% if memory.handles %}
            <div class="tab-pane fade show" id="memory_handles">
                {% include "analysis/memory/_handles.html" %}
            </div>
            {% endif %}
            {% if memory.getsids %}
            <div class="tab-pane fade show" id="memory_getsids">
                {% include "analysis/memory/_getsids.html" %}
            </div>
            {% endif %}
            {% if memory.dlllist %}
            <div class="tab-pane fade show" id="memory_dlllist">
                {% include "analysis/memory/_dlllist.html" %}
            </div>
            {% endif %}
            {% if memory.mutantscan %}
            <div class="tab-pane fade show" id="memory_mutantscan">
                {% include "analysis/memory/_mutantscan.html" %}
            </div>
            {% endif %}
        </div>
    </div>
{% else %}
    <div class="alert alert-secondary"><b>Sorry!</b> No Memory details.</div>
{% endif %}
